﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Snake.Extensions
{
    public static class ObjectExtensions
    {
        /// <summary>
        /// 如果 对象为null 抛出ArgumentNull 异常，argname为传入的对象名称
        /// </summary>
        /// <param name="arg"></param>
        /// <param name="argName"></param>
        public static void GuardArgumentNull(this object arg, string argName)
        {
            if (arg == null)
            {
                throw new ArgumentNullException(argName);
            }
        }
    }
}
